Skip to content

chore(ai-gemini): sync model meta with Google's current model list#714

Merged
tombeckenham merged 2 commits into
TanStack:mainfrom
season179:gemini-model-meta-refresh
Jun 9, 2026
Merged

chore(ai-gemini): sync model meta with Google's current model list#714
tombeckenham merged 2 commits into
TanStack:mainfrom
season179:gemini-model-meta-refresh

Conversation

@season179

@season179 season179 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #620, closes #621.

Syncs @tanstack/ai-gemini model metadata with Google's current published model list, migrates every workspace consumer off the retired ids, and fixes the structured-output demo dropdown.

All removals/additions were verified against the live API (GET /v1beta/models + real generateContent calls on a paid Tier 1 key) on 2026-06-06, not just the docs page.

Added

  • gemini-3.1-flash-lite (stable GA) to model-meta, all type maps, and GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS — it round-trips the native combined tools+schema path. The existing preview const was renamed GEMINI_3_1_FLASH_LITEGEMINI_3_1_FLASH_LITE_PREVIEW to follow the stable/_PREVIEW naming convention used by the 2.5 line.

Removed (verified retired)

id live API status successor
gemini-3-pro-preview 404 ("no longer available") gemini-3.1-pro-preview
gemini-2.5-flash-preview-09-2025 gone from /v1beta/models gemini-2.5-flash
gemini-2.5-flash-lite-preview-09-2025 gone from /v1beta/models gemini-2.5-flash-lite
gemini-2.0-flash docs-retired gemini-2.5-flash
gemini-2.0-flash-lite docs-retired gemini-2.5-flash-lite
gemini-2.0-flash-preview-image-generation gone from /v1beta/models gemini-2.5-flash-image

Note: gemini-2.0-flash / -lite still respond at the API level (deprecation grace), but they're gone from the published docs per the #620 acceptance criteria, so they're removed here.

Drive-by fixes (beyond the strict issue text, all small and disclosed here)

  • gemini-3.5-flash was missing from GeminiChatModelToolCapabilitiesByName, so its provider-tool typing was broken. One-line fix in a map this PR rewrites anyway.
  • gemini-3.5-flash was grouped under "no document" in GeminiModelInputModalitiesByName despite supports.input including document.
  • Display labels next to migrated model values: the svelte/vue/panel model-selection lists ended up with a duplicate gemini-2.5-flash entry (the old 2.0-flash row pointed at the same id) — duplicates removed, stale "Gemini - 2.0 Flash" labels updated. Same label sync in the panel's structured/summarize provider chips and its OpenRouter row.
  • Removed two stale commented-out blocks in model-meta.ts: the GEMINI_2_FLASH_LIVE draft (a retired 2.0-line id) and a GEMINI_MODEL_META draft that referenced consts deleted by this PR. Happy to restore if you prefer the tighter diff.

Consumer migration (#620 cascade)

  • testing/e2e (providers, summarize route, media-providers), testing/panel (model-selection, chat/structured/summarize/image routes, vendor-config), ai-code-mode-skills test CLI, and the react/svelte/vue chat examples.
  • Panel's OpenRouter entry google/gemini-2.0-flash-001google/gemini-2.5-flash (validated against the OpenRouter catalog).
  • Docs: stale ids corrected in adapters/gemini.md, adapters/openrouter.md (google/gemini-3-pro-preview isn't in OpenRouter's catalog either), advanced/multimodal-content.md, media/image-generation.md, and the ai-core skill reference. Factual fixes only — no addedAt/updatedAt bumps.
  • Deliberately untouched: ai-openrouter/model-meta.ts and scripts/openrouter.models.json (nightly-synced from OpenRouter), community-adapters/cencori.md (third-party service's own table).

Tests

The retired 2.0 line was the last chat model without thinking support, so the "models WITHOUT thinking" type-test category is gone. Those negative tests were replaced with retired-id rejection tests — geminiText('gemini-2.0-flash') / geminiText('gemini-3-pro-preview') are now compile errors, guarded by @ts-expect-error. The mixed accept/reject tool-gating coverage moved from gemini-2.0-flash-lite (rejected everything) to gemini-2.5-flash-lite (partial tool set, still exercises both directions). Full positive coverage added for the new stable gemini-3.1-flash-lite.

Demo (#621)

  • Dropdown: removed gemini-3-pro-preview (404s), added gemini-3.1-flash-lite.
  • Server fallback default: gemini-3-pro-previewgemini-3.5-flash — picked because it's the newest stable (non-preview) 3.x id and matches the dropdown's first entry; gemini-3.1-pro-preview is still a preview id. Happy to switch if you'd rather default to the pro line.

Open questions for maintainers

  1. imagen-3.0-generate-002 is also gone from the live API (verified), but chore(ai-gemini): remove retired model ids + cascade workspace consumer migration #620 scoped imagen variants as out-of-scope-but-check. It's kept in this PR. Want me to remove it here too, or file a follow-up issue?
  2. Fallback defaultgemini-3.5-flash (stable) vs gemini-3.1-pro-preview (newer flagship, but preview). Currently stable wins; say the word and I'll flip it.

Verification

  • pnpm test:pr — green (sherif/knip/docs/eslint/lib/types/build, 32 projects)
  • E2E suite — 253 passed, 0 failed (10 flaky-passed on non-Gemini providers, pre-existing)
  • Live round-trip of every dropdown entry through /api/structured-output on a paid key — all five stream and deliver structured-output.complete:
  • gemini-3.5-flash
  • gemini-3-flash-preview
  • gemini-3.1-pro-preview
  • gemini-3.1-flash-lite
  • gemini-3.1-flash-lite-preview

Summary by CodeRabbit

  • Documentation

    • Updated docs and tables to reflect current Gemini models, image-model availability, and multimodal capabilities.
  • Chores

    • Synchronized supported Gemini models with Google's published list: added newer models (notably gemini-3.1-flash-lite and gemini-2.5-flash), removed retired IDs, and updated defaults and UI labels across examples and demos.
  • Tests

    • Expanded tests and type-safety checks to cover new models and assert removal of retired ones.
  • Bug Fixes

    • Fixed a missing capability mapping for a Gemini model.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 283fbdca-07e8-46b8-b711-5b20f477dbcd

📥 Commits

Reviewing files that changed from the base of the PR and between 83510dc and c38bd40.

📒 Files selected for processing (1)
  • packages/ai/skills/ai-core/adapter-configuration/references/gemini-adapter.md
✅ Files skipped from review due to trivial changes (1)
  • packages/ai/skills/ai-core/adapter-configuration/references/gemini-adapter.md

📝 Walkthrough

Walkthrough

Refreshes Gemini model metadata and types (adds stable gemini-3.1-flash-lite, removes retired 2.x/preview ids), updates registries/type maps, and migrates workspace consumers (examples, tests, E2E, panel, docs, and CLI) to current Gemini model IDs.

Changes

Gemini Model Metadata Refresh and Consumer Migration

Layer / File(s) Summary
Core model metadata, types, and registries
packages/ai-gemini/src/model-meta.ts, packages/ai-gemini/src/image/image-provider-options.ts
Model constants and pricing changed (replace GEMINI_3_PRO with GEMINI_3_FLASH, add GEMINI_3_1_FLASH_LITE/preview, remove older 2.x previews). Exported registries (GEMINI_MODELS, GEMINI_IMAGE_MODELS, GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS) and type maps (GeminiChatModelProviderOptionsByName, GeminiChatModelToolCapabilitiesByName, GeminiModelInputModalitiesByName) updated accordingly. GeminiNativeImageModels union removes the retired image id.
Type-safety and metadata tests
packages/ai-gemini/tests/*
Compile-time and runtime tests updated: add stable gemini-3.1-flash-lite coverage (thinking + structured-output), add gemini-3.5-flash assertions, remove retired-model assertions, and update tool-gating and modality assertions.
Adapter tests and expected payloads
packages/ai-gemini/tests/gemini-adapter.test.ts
Adapter tests updated to expect current model IDs (e.g., gemini-2.5-flash for summarize, gemini-3.1-pro-preview in combined-mode tests).
Example applications: defaults and dropdowns
examples/*/src/lib/model-selection.ts, examples/*/src/routes/*
Example apps migrated from gemini-2.0-flash to gemini-2.5-flash as defaults; structured-output dropdowns remove gemini-3-pro-preview and add gemini-3.1-flash-lite. API route defaults updated.
E2E and testing panel defaults
testing/e2e/*, testing/panel/*
E2E providers and media providers now use gemini-2.5-flash / gemini-2.5-flash-image. Testing panel model selections, API route defaults, and vendor test config updated to current IDs and OpenRouter Gemini naming.
Docs, JSDoc examples, CLI defaults, changeset
docs/*, packages/ai-gemini/src/adapters/summarize.ts, packages/ai-code-mode-skills/*, .changeset/*
Documentation tables and references updated (image models, multimodal docs, adapter reference). JSDoc examples and CLI/env defaults set to gemini-2.5-flash. Changeset updated to document removed IDs, added stable model, and migration guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TanStack/ai#691: touches Gemini model identifiers in multimodal-content docs — related documentation area.
  • TanStack/ai#609: added native combined tools+schema routing that depends on GEMINI model registries — related to updated registries and maps.

Suggested reviewers

  • tombeckenham
  • AlemTuzlak
  • jherr

"🐰 I hopped through registries, swapped old ids for new,
Three-one-flash-lite now takes its place in view.
Two-point-five skipped along the garden test,
Docs and demos sing — migrations all addressed.
A tiny carrot of change for reviewers to chew!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: syncing Gemini model metadata with Google's current model list. It is concise, clear, and specific.
Description check ✅ Passed The description is comprehensive and well-structured, covering changes, migration details, verification, and open questions. It exceeds template requirements with thorough documentation.
Linked Issues check ✅ Passed The PR directly addresses all requirements from #620 and #621: removes retired model IDs, adds stable gemini-3.1-flash-lite, fixes tool capabilities, migrates consumers, updates dropdown, and includes test coverage.
Out of Scope Changes check ✅ Passed All changes are directly scoped to syncing Gemini model metadata and migrating consumers. Documentation updates, test modifications, and UI label corrections are all aligned with the stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@season179 season179 marked this pull request as ready for review June 6, 2026 04:57
Remove retired Gemini ids (gemini-3-pro-preview, the 09-2025 2.5
previews, and the 2.0 line), add the stable gemini-3.1-flash-lite, and
migrate every workspace consumer off the removed ids. Also fixes the
structured-output demo dropdown, which still offered the retired
gemini-3-pro-preview as its default.

All removals were verified against the live API, not just the docs
page. Includes a couple of small fixes found along the way: missing
gemini-3.5-flash entries in the tool-capability and modality maps, and
stale display labels left next to migrated model values.

Closes TanStack#620, closes TanStack#621
@season179 season179 force-pushed the gemini-model-meta-refresh branch from 8ed0409 to 83510dc Compare June 8, 2026 13:33
@tombeckenham tombeckenham self-requested a review June 9, 2026 00:09
…nt-input note

Add the stable gemini-3.1-flash-lite row to the skill reference's Key
Chat Models table, and fix the modality note that wrongly claimed all
Gemini text models accept document input — gemini-2.5-flash does not.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tombeckenham tombeckenham merged commit efa76c8 into TanStack:main Jun 9, 2026
3 checks passed
@tombeckenham

Copy link
Copy Markdown
Contributor

Thanks @season179 !

@season179 season179 deleted the gemini-model-meta-refresh branch June 9, 2026 00:41
@season179

Copy link
Copy Markdown
Contributor Author

No problem! I love the recent releases and want to be part of the movement.

@github-actions github-actions Bot mentioned this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants